package org.zwy.gradetrack.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.FieldFill;
import lombok.Data;
import java.time.LocalDateTime;

/**
 * 操作日志实体类
 */
@Data
@TableName("operation_log")
public class OperationLog {
    
    /**
     * 日志ID
     */
    @TableId(type = IdType.AUTO)
    private Long id;
    
    /**
     * 用户ID
     */
    private Long userId;

    /**
     * 用户名（非数据库字段）
     */
    @TableField(exist = false)
    private String username;
    
    /**
     * 操作模块
     */
    @TableField(value = "operation_module")
    private String operationModule = "系统操作";
    
    /**
     * 操作类型(查询/新增/修改/删除)
     */
    private String operationType;
    
    /**
     * 操作描述
     */
    private String operationDesc;
    
    /**
     * 操作IP
     */
    @TableField(value = "operation_ip")
    private String operationIp = "127.0.0.1";
    
    /**
     * 操作时间
     */
    private LocalDateTime operationTime;
    
    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;
    
//    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
//    private LocalDateTime updateTime;
} 